package com.nulldev.util.web.YouTubeExtractor.subtitles.misc;

import com.nulldev.util.JVM.JVM;
import com.nulldev.util.VariableAPI.MathUtil.TimeUtil;

public class TimestampGenTest {

	public static void main(String[] args) {
		final long from = 539453453;
		final long to = 539953453;
		final boolean enableLegacySpecWorkaround = true;
		final boolean treatAsMills = true;
		final String c0 = treatAsMills ? convertNative(from, enableLegacySpecWorkaround) : convert(from, enableLegacySpecWorkaround);
		final String c1 = treatAsMills ? convertNative(to, enableLegacySpecWorkaround) : convert(to, enableLegacySpecWorkaround);
		JVM.println(c0 + " --> " + c1);
	}

	private static String convert(final float seconds, final boolean useWorkaround) {
		return TimeUtil.milliToString((long) (seconds * 1000), useWorkaround);
	}

	private static String convertNative(final float seconds, final boolean useWorkaround) {
		return TimeUtil.milliToString((long) seconds, useWorkaround);
	}

}
